(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92508,e=>{"use strict";var t=e.i(43476),l=e.i(71645),n=e.i(45144),r=e.i(46119),s=e.i(14715);e.s(["LandingGallerySection",0,function({images:e,onOpen:a,onBroken:i}){let{carouselIntervalMs:o}=(0,r.useLandingRuntime)(),c=(0,l.useRef)(null),[u,d]=(0,l.useState)(0),h=(0,l.useRef)(!1),g=(0,l.useRef)(null);(0,s.useCarouselTouchAxis)(c);let f=(0,l.useCallback)(()=>{let t=c.current;if(!t||!e.length)return;let l=t.querySelectorAll(".gitem");if(!l.length)return;let n=t.scrollLeft+t.clientWidth/2,r=0,s=1/0;l.forEach((e,t)=>{let l=Math.abs(e.offsetLeft+e.offsetWidth/2-n);l{let t=c.current;if(!t)return;let l=t.querySelectorAll(".gitem")[e];if(!l)return;let n=l.offsetLeft-(t.clientWidth-l.offsetWidth)/2;t.scrollTo({left:Math.max(0,n),behavior:"smooth"}),d(e)},[]),x=(0,l.useCallback)(()=>{h.current=!0,g.current&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>{h.current=!1},8e3)},[]),b=(0,l.useCallback)(t=>{e.length&&(x(),d(l=>{let n=(l+t+e.length)%e.length;return m(n),n}))},[e.length,x,m]);if((0,l.useEffect)(()=>{let e=c.current;if(!e)return;f();let t=()=>f();return e.addEventListener("scroll",t,{passive:!0}),()=>e.removeEventListener("scroll",t)},[e,f]),(0,l.useEffect)(()=>{if(e.length<=1)return;let t=window.matchMedia("(max-width: 920px)"),l=window.setInterval(()=>{!t.matches||h.current||document.hidden||d(t=>{let l=(t+1)%e.length;return m(l),l})},o);return()=>window.clearInterval(l)},[e.length,m,o]),!e.length)return null;let v=e.length>1;return(0,t.jsx)("section",{id:"gallerySec",children:(0,t.jsxs)("div",{className:"wrap",children:[(0,t.jsxs)("div",{className:"sec-head rv",children:[(0,t.jsx)("div",{className:"eyebrow2",children:(0,t.jsx)(n.LandingText,{k:"g_eb"})}),(0,t.jsxs)("h2",{children:[(0,t.jsx)(n.LandingText,{k:"g_h2"}),(0,t.jsx)("span",{className:"en",children:(0,t.jsx)(n.LandingText,{k:"g_en"})})]})]}),(0,t.jsxs)("div",{className:"ggal-shell",children:[v?(0,t.jsx)("button",{type:"button",className:"ggal-nav ggal-prev","aria-label":"Previous photo",onClick:()=>b(-1),children:"‹"}):null,(0,t.jsx)("div",{className:"ggal ggal--slider",ref:c,onTouchStart:x,onMouseDown:x,children:e.map((e,l)=>(0,t.jsx)("div",{className:"gitem in",style:{transitionDelay:`${l%3*.12}s`},onClick:()=>{x(),a(e)},onKeyDown:t=>"Enter"===t.key&&a(e),role:"button",tabIndex:0,children:(0,t.jsx)("img",{src:e,alt:`HERBVEDA B12 photo ${l+1}`,loading:"lazy",draggable:!1,onError:()=>i(e)})},`${e}-${l}`))}),v?(0,t.jsx)("button",{type:"button",className:"ggal-nav ggal-next","aria-label":"Next photo",onClick:()=>b(1),children:"›"}):null]}),v?(0,t.jsx)("div",{className:"ggal-dots",children:e.map((e,l)=>(0,t.jsx)("button",{type:"button",className:l===u?"on":void 0,"aria-label":`Photo ${l+1}`,onClick:()=>{x(),m(l)}},`dot-${e}-${l}`))}):null,v?(0,t.jsx)("p",{className:"ggal-swipe-hint",children:(0,t.jsx)(n.LandingText,{k:"sw_gal"})}):null]})})}])},1964,e=>{e.n(e.i(92508))}]);